import { fabric } from "fabric-with-erasing";
//铅笔
export default function (fabricCanvas: HTMLCanvasElement, opt: any) {
  const conf = opt ?? { width: 2, color: "000" };

  const pencilBrush = new fabric.PencilBrush(fabricCanvas, {
    selectable: false,
  });
  pencilBrush.color = conf.color || "blue"; // 设置颜色
  pencilBrush.width = conf.width || 2; // 设置画笔宽度
  pencilBrush.selectable = false;

  return pencilBrush;
}
